package org.jeecg.modules.demo.play.mapper;

import java.util.List;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.demo.play.entity.MStoryInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.demo.play.entity.MStoryResourceInfo;

/**
 * @Description: 故事情节
 * @Author: jeecg-boot
 * @Date:   2024-07-09
 * @Version: V1.0
 */
public interface MStoryInfoMapper extends BaseMapper<MStoryInfo> {
    @Select({"SELECT m_story_info.*,file.url FROM m_story_info LEFT JOIN " +
            "(SELECT * FROM m_file WHERE type = 'img') file " +
            "ON m_story_info.resource_id = file.resource_id" +
            " ${ew.customSqlSegment}"})
    List<MStoryResourceInfo> queryStoryResourceInfoList(@Param(Constants.WRAPPER) QueryWrapper<MStoryInfo> queryWrapper);
}
